<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Classroom Delete</title>
</head>

<body>

<?php
//get num_rows currently in buildings table
$building_id = $_GET['bid'];
$building_name = $_GET['name'];
$classroom_id = $_GET['id'];
$abbreviation = $_GET['abbrev'];

echo "<h1>UNO Course Scheduler - Delete Classroom in $building_name</h1>";

//initialize variables used to connect to database
$db = "scheduler";
$user = "root";
$pass = "";

$i = 0;

//connect to database
mysql_connect("localhost", $user, $pass);
@mysql_select_db($db);

//select statement
$query="SELECT * FROM classrooms WHERE id='$classroom_id'";
$result = mysql_query($query);

//close
mysql_close();

$room_num=mysql_result($result,$i,"room_num");

echo "<p>";
echo "Are you sure you want to delete <b>$abbreviation $room_num?</b>";

echo '<form action="delete_do.php">';
echo "<input type='hidden' name='bid' value='$building_id'>";
echo "<input type='hidden' name='id' value='$classroom_id'>";
echo "<input type='hidden' name='name' value='$building_name'>";
echo "<input type='hidden' name='abbrev' value='$abbreviation'>";
echo "<input type='hidden' name='num' value='$room_num'>";
echo '<input type="submit" value="Yes">';
echo '</form>';

echo "</p>";

echo "<p>";
	echo "<a href='index.php?id=$building_id&name=$building_name&abbrev=$abbreviation'>&lt;&lt; Back to Classrooms Portal</a><br />";
echo "</p>";
?>
</body>
</html>